package com.gator.desig_mode.dicorator;


import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

/**
 * @author 何章怀晓 hezhanghuaixiao
 * @version V1.0
 * @desc
 */
public class Test {

  public static void main(String[] args) throws FileNotFoundException {
    //意大利咖啡+2个牛奶 + 1个酱油

    Drink drink = new Espresso();
    System.out.println(drink.cost());
    System.out.println(drink.getDesc());

    System.out.println("+牛奶");
    drink = new Milk(drink);
    System.out.println(drink.cost());
    System.out.println(drink.getDesc());
    System.out.println("+牛奶");
    drink = new Milk(drink);
    System.out.println(drink.cost());
    System.out.println(drink.getDesc());
    System.out.println("+酱油");
    drink = new Soy(drink);
    System.out.println(drink.cost());
    System.out.println(drink.getDesc());




  }

}
